import request from './request'
export const getsubjects = (params) => {
  return request({
    url: '/api/admin/subjects',
    method: 'GET',
    params
  })
}
export const getsubject = (params) => {
  return request({
    url: '/api/admin/subjectList',
    method: 'GET',
    params
  })
}

// 根据id查询subject
export const getsubjectfromid = (params) => {
  return request({
    url: '/api/admin/subject/' + params,
    method: 'GET',
    params
  })
}

// 删除
export const deletesubject = (sid) => {
  return request({
    url: `/api/admin/subject/${sid}`,
    method: 'DELETE'
  })
}

// 修改subject信息
export const editsubject = (params) => {
  return request({
    url: '/api/admin/subject ',
    method: 'PUT',
    params
  })
}

export const addsubject = (data) => {
  return request({
    url: '/api/admin/subject ',
    method: 'POST',
    data
  })
}
